package com.lifa.test;

/**
 * 123
 */
import com.lifa.dao.*;
import com.lifa.entity.*;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class SZStest {
    private static ApplicationContext applicationContext;
    private static RuKuDao ruKuTongJiDao;
    private static XiaoFeiTableDao xiaoFeiTableDao;
    private static XiaoFeiMXTableDao xiaoFeiMXTableDao;
    private static XiaoFeiHuiZongDao xiaoFeiHuiZongDao;
    private static YuangongtchuizongDao yuangongtchuizongDao;
    private static TuihuotongjiDao tuihuotongjiDao;

    static {
        applicationContext=new ClassPathXmlApplicationContext("spring.xml");
        ruKuTongJiDao=(RuKuDao) applicationContext.getBean("ruKuDao");
        xiaoFeiTableDao=(XiaoFeiTableDao) applicationContext.getBean("xiaoFeiTableDao");
        xiaoFeiMXTableDao=(XiaoFeiMXTableDao) applicationContext.getBean("xiaoFeiMXTableDao");
        xiaoFeiHuiZongDao=(XiaoFeiHuiZongDao) applicationContext.getBean("xiaoFeiHuiZongDao");
        yuangongtchuizongDao=(YuangongtchuizongDao) applicationContext.getBean("yuangongtchuizongDao");
        tuihuotongjiDao=(TuihuotongjiDao) applicationContext.getBean("tuihuotongjiDao");
    }

    public static void testQuery(){
//        List<Kucun> list=ruKuTongJiDao.query(0,0,2);
//
//        for (Kucun kucun:list){
//            System.out.print(kucun.getKucunId_Danjuhao()+"---"+kucun.getDianpu_name());
//        }
//        System.out.print(ruKuTongJiDao.getTotalCount(0));
    }


    public static void testQueryMX(){
//        List<Kucun> list=ruKuTongJiDao.queryRuKuMX(0,0,2);
//
//        for (Kucun kucun:list){
//            System.out.print(kucun.rukushijian+"---"+kucun.getDianpu_name()+"---"+kucun.getLeixing_name()+"---"+kucun.getShangpin_name()+"---"+kucun.getRukushijian()+"---"+kucun.getKucunshul()+"---"+kucun.getBanliren()+"---"+kucun.getKucunId_Danjuhao()+"---"+kucun.getBeizhu());
//        }
    }

    public static void testMX(){
//        List<Kucun> list=ruKuTongJiDao.getAllRuKujmx();
//        for (Kucun kucun:list){
//            System.out.print(kucun.getShangpin_id()+"---"+kucun.getShangpin_name());
//        }
    }

    //消费统计
    public static void testxiaofei(){
//        List<XiaoFeiTab> list=xiaoFeiTabDao.GetAllList();
//
//        for (XiaoFeiTab x:list){
//            System.out.print(x.getHuiyuan_name()+"---"+x.getDianpu_name());
//        }
        List<XiaoFeiTable> list=xiaoFeiTableDao.query(0,0,1);

        for (XiaoFeiTable x:list){
            System.out.print(x.getJiezhangshijian()+"---"+x.getDianpi_Name()+"---"+x.getHuiyuan_Id()+"---"+x.getHuiyuan_Name()+"---"+x.getXiaofeijine()+"---"+x.getChongzhi_Name()+"---"+x.getCaozuoyuan());
        }
    }


    //消费明细统计
    public static void testxiaofeimx(){
        List<XiaoFeiMXTable> list=xiaoFeiMXTableDao.query("",0,2);
//                System.out.print(list);
        for (XiaoFeiMXTable x:list){
            System.out.print("");
        }
    }


    public static void testxiaofeihz(){
        List<Taocan> list=xiaoFeiHuiZongDao.query("",0,1);
        for (Taocan t:list){
            System.out.print(t.getTaocan_Name()+"---"+t.getFuwuxiangmu_Name());
        }
    }


public static void testyuangonghuizong(){
        List<Yuangongtchuizong> list=yuangongtchuizongDao.query("",0,1);
        for (Yuangongtchuizong y:list){
            System.out.print(y.getDianpu_Name());
        }
}



public static void testtuihuotongji(){
       List<Tuihuotongji> list=tuihuotongjiDao.query("普",0,1);
       for (Tuihuotongji t:list){
           System.out.print(t.getFuwu_name());
       }
    }


    public static void testdanhao(){
//        List<XiaoFeiTable> list=xiaoFeiTableDao.listDanhao("XF201811221718");
//        for (XiaoFeiTable x:list){
//            System.out.print(x.getHuiyuan_Name());
//        }
    }


    public static void main(String[] args) {
        //testQuery();
        //testQueryMX();
        //testMX();
        //testxiaofei();
        //testxiaofeimx();
        //testxiaofeihz();
        //testyuangonghuizong();
        //testtuihuotongji();
        testdanhao();
    }
}
